package com.thethinkfactory.whosappfor.model.db;

import android.database.sqlite.SQLiteDatabase;

public class TableUser {

	public static final String TABLE_NAME = "user";
	public static final String COLUMN_ID = "_id";
	public static final String COLUMN_FIRSTNAME = "firstname";
	public static final String COLUMN_LASTNAME = "lastname";
	public static final String COLUMN_ALIAS = "alias";

	private static final String TABLE_CREATE = "create table " + TABLE_NAME
			+ " (" + COLUMN_ID + " integer primary key autoincrement, "
			+ COLUMN_FIRSTNAME + " text not null, " + COLUMN_LASTNAME
			+ " text not null, " + COLUMN_ALIAS + " text not null);";

	public static void onCreate(SQLiteDatabase database) {
		database.execSQL(TABLE_CREATE);
	}

	public static void onUpgrade(SQLiteDatabase database, int oldVersion,
			int newVersion) {
		database.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
		onCreate(database);
	}
}
